//
//  Constant.h
//  NinjaTurtle
//
//  Created by Nguyen Tri Chung on 1/6/15.
//
//

/*
- Note test behavior in Business Handler case EVT_START_GAME
 
 */


#ifndef __NinjaTurtle__Constant__
#define __NinjaTurtle__Constant__

#include <stdio.h>

enum MoveState {
    MOVE_LEFT,
    MOVE_RIGHT,
    MOVE_NONE
};

enum TouchDirection {
    TOUCH_LEFT,
    TOUCH_RIGHT,
    TOUCH_UP,
    TOUCH_DOWN,
    TOUCH_NONE
};

#define STRING_PRODUCT_NAME "Ninja Turtle"

#define CONFIG_DESIGN_RESOLUTION_WIDTH 480
#define CONFIG_DESIGN_RESOLUTION_HEIGHT 320
#define CONFIG_DESIGN_RESOLUTION_POLICY ResolutionPolicy::FIXED_HEIGHT
#define CONFIG_RANGE_TO_MOVE 100
#define CONFIG_ACCEL_WORLD 600
#define CONFIG_INTRO_ACCEL_WORLD 300
#define CONFIG_MAX_RANDOM_MUSIC 4
#define CONFIG_TOTAL_LEVELS 65
#define CONFIG_COMMAND_PADDING 50
#define CONFIG_VISUAL_RANGE_ENEMY_WIDTH 400
#define CONFIG_VISUAL_RANGE_ENEMY_HEIGHT 16

#define CONFIG_JUMP_HEIGHT 35
#define CONFIG_SUDDEN_JUMP_HEIGHT 150
#define CONFIG_FAST_JUMP_HEIGHT 70
#define CONFIG_ANGEL_JUMP_HEIGHT 50

#define CONFIG_FAST_MOVE_SPEED 140
#define CONFIG_ANGEL_MOVE_SPEED 150
#define CONFIG_MOVE_SPEED 100
#define CONFIG_TELEPORT_MOVE_SPEED 2000

#define CONFIG_DELAY_TO_NEXT_MAP 2
#define CONFIG_DELAY_PER_FIRE_MACHINE 2
#define CONFIG_DELAY_PER_FIRE_AIMBOT 2.5
#define CONFIG_DELAY_PER_FIRE_WARRIOR 0.2
#define CONFIG_DELAY_PER_FIRE_CRUSHER 2
#define CONFIG_MOVE_Y_WARRIOR_BULLET 5
#define CONFIG_FIRE_SPEED_WARRIOR 200
#define CONFIG_FIRE_SPEED_TURTLE 200
#define CONFIG_FIRE_SPEED_AIMBOT 120
#define CONFIG_BELT_SPEED 50
#define CONFIG_MAX_VOLUME_EFFECT 1
#define CONFIG_MAX_VOLUME_MUSIC 0.5
#define CONFIG_ROTATION_SPEED_SHURIKEN 1000

#define MOVE_COMMAND_LEFT "left"
#define MOVE_COMMAND_RIGHT "right"

#define FRAME_BUTTON_LEFT "hud/left.png"
#define FRAME_BUTTON_RIGHT "hud/right.png"
#define FRAME_BUTTON_A "hud/button-a.png"
#define FRAME_BUTTON_B "hud/button-b.png"
#define FRAME_BUTTON_C "hud/button-c.png"

#define DURATION_STEP_LOGO 5
#define DURATION_STEP_WARNING 5
#define DURATION_STEP_MAGIC 5

#define BIND_DELIMITER '$'
#define BIND_PATTERN_CONNECTOR "-"
#define BIND_PATTERN_SUFFIX "-%d.png"
#define BIND_CONSTANT_SUFFIX "-1.png"
#define BIND_DEFAULT_DURATION_PER_FRAME 0.1f
#define BIND_PLIST_FRAMES_NODE "frames"
#define BIND_NOT_LOOP "-not-loop"
#define BIND_LOOP "-loop"

#define PLIST_GAME_OBJECT_SD "game-objects-sd.plist"

#define TURTLE_SPEED 7
#define TURTLE_JUMP_SPEED 20

#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
    #define DOC_MAP_TMX "maps/level_%d.tmx"
    #define EFFECT_DIE "sounds/die.mp3"
    #define EFFECT_TELEPORT "sounds/teleport.mp3"
    #define EFFECT_END "sounds/end.mp3"
    #define EFFECT_JUMP "sounds/jump.mp3"
    #define EFFECT_SHOT "sounds/shot.mp3"
    #define EFFECT_SLASH "sounds/slash.mp3"
    #define EFFECT_STEAL "sounds/steal.mp3"
    #define EFFECT_STOMP "sounds/stomp.mp3"
    #define EFFECT_BUTTON "sounds/button.mp3"
    #define EFFECT_COMMAND "sounds/command.mp3"
    #define EFFECT_SELECT "sounds/select.mp3"
    #define EFFECT_HIT_HUMAN "sounds/hit-human.mp3"
    #define EFFECT_HIT_LAND "sounds/hit-land.mp3"
    #define EFFECT_HIT_MACHINE "sounds/hit-machine.mp3"
    #define EFFECT_CRUSH "sounds/crush.mp3"

    #define MUSIC_GAME "sounds/random-%d.mp3"
    #define FONT_ARCADE "font/8-BIT WONDER.TTF"
#endif
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
    #define DOC_MAP_TMX "level_%d.tmx"
    #define EFFECT_DIE "die.mp3"
    #define EFFECT_TELEPORT "teleport.mp3"
    #define EFFECT_END "end.mp3"
    #define EFFECT_JUMP "jump.mp3"
    #define EFFECT_SHOT "shot.mp3"
    #define EFFECT_SLASH "slash.mp3"
    #define EFFECT_STEAL "steal.mp3"
    #define EFFECT_STOMP "stomp.mp3"
    #define EFFECT_BUTTON "button.mp3"
    #define EFFECT_COMMAND "command.mp3"
    #define EFFECT_SELECT "select.mp3"
    #define EFFECT_HIT_HUMAN "hit-human.mp3"
    #define EFFECT_HIT_LAND "hit-land.mp3"
    #define EFFECT_HIT_MACHINE "hit-machine.mp3"
    #define EFFECT_CRUSH "crush.mp3"

    #define MUSIC_GAME "random-%d.mp3"
    #define FONT_ARCADE "8-BIT WONDER.TTF"
#endif

#define SPRITE_TYPE_MAIN "sprite-main"

#define FONT_DEFAULT "Arial"

#define TEXT_WARNING "TEXT_WARNING"

#define EVT_START_GAME 1
#define EVT_STOP_GAME 2
#define EVT_PLAY_GAME 3
#define EVT_MAP_CREATED 4
#define EVT_REPLAY_MAP 5
#define EVT_NEXT_MAP 6
#define EVT_COMPLETED_GAME 101
#define EVT_RESET_GAME 102
#define EVT_CHANGE_MUSIC 103
#define EVT_CHANGE_EFFECT 104
#define EVT_LOGO_TOUCH_LAND 105
#define EVT_LOGO_LAND 106
#define EVT_CLICK_BUTTON 107
#define EVT_CHANGE_COMMAND 108
#define EVT_PAUSE_GAME 109
#define EVT_RESUME_GAME 110
#define EVT_QUIT_GAME 111
#define EVT_SELECT 112
#define EVT_EXIT_GAME 113

#define EVT_GO_LEFT 7
#define EVT_GO_RIGHT 8
#define EVT_GO_NONE 9
#define EVT_JUMP 10
#define EVT_RECEIVE_HINT 11
#define EVT_LOSE_HINT 12
#define EVT_EQUIP 13
#define EVT_ENEMY_LOST_EQUIPMENT 14
#define EVT_NEW_BULLET 15
#define EVT_LOST_BULLET 16
#define EVT_FIRE 17
#define EVT_ENEMY_BEING_SHOOTED 18
#define EVT_TREE_BEING_CUT 19
#define EVT_BACK_LEVEL_FROM_LEVEL 20
#define EVT_TURTLE_DIE 21
#define EVT_TURTLE_PASS 22
#define EVT_TURTLE_TELEPORT 23
#define EVT_TURTLE_SLASH 24
#define EVT_BULLET_HIT_HUMAN 25
#define EVT_BULLET_HIT_LAND 26
#define EVT_BULLET_HIT_MACHINE 27
#define EVT_CRUSH 28

#define GS_LOAD 0
#define GS_PLAY 1
#define GS_PAUSE 2
#define GS_WAIT 3
#define GS_FINISH 4
#define GS_REPLAY 5

#define SCHEDULE_GAME_MODEL 1
#define SCHEDULE_SCENE 2
#define SCHEDULE_LAYER 3

#define INDEX_TILE 1
#define INDEX_OBJECT 2
#define INDEX_OBJECT_HIGH 3
#define INDEX_TURTLE 4

#define PTM_RATIO 32.0f
#define SCREEN_TO_WORLD(n) ((n) / PTM_RATIO)
#define WORLD_TO_SCREEN(n) ((n) * PTM_RATIO)
#define B2_ANGLE_TO_COCOS_ROTATION(n) (-1 * CC_RADIANS_TO_DEGREES(n))
#define COCOS_ROTATION_TO_B2_ANGLE(n) (CC_DEGREES_TO_RADIANS(-1 * n))

#define BULLET_TYPE_ENEMY "enemy"

#define EQUIPMENT_NONE ""
#define EQUIPMENT_DEATH "death"

#define EQUIPMENT_FAST "fast"
#define EQUIPMENT_STRENGTH "strength"
#define EQUIPMENT_WARRIOR "warrior"
#define EQUIPMENT_ANGEL "angel"
#define EQUIPMENT_NINJA "ninja"

#define OBJECT_PLATFORM "platform"
#define OBJECT_TREE "tree"
#define OBJECT_ROCK "rock"
#define OBJECT_LEFT_BELT "left-belt"
#define OBJECT_MID_BELT "mid-belt"
#define OBJECT_RIGHT_BELT "right-belt"
#define OBJECT_FINISH "finish"
#define OBJECT_PLAYER "player"
#define OBJECT_HINT "hint"
#define OBJECT_SPIKE "spike"
#define OBJECT_AIR "air"
#define OBJECT_NAIR "nair"
#define OBJECT_AIM "aim"
#define OBJECT_CRUSHER "crusher"
#define OBJECT_TELEPORT "teleport"

#define FRAME_BG_1 "background/bg1_layer1.png"
#define FRAME_BG_2 "background/bg1_layer2.png"
#define FRAME_BG_3 "background/bg1_layer3.png"

#define FRAME_TURTLE_IDLE "player/player_idle"
#define FRAME_TURTLE_FALL "player/player_fall"
#define FRAME_TURTLE_JUMP "player/player_jump"
#define FRAME_TURTLE_MOVE "player/player_move"
#define FRAME_TURTLE_DIE "player/player_die"

#define FRAME_TURTLE_IDLE_FAST "colonist/colonist_infested_idle"
#define FRAME_TURTLE_FALL_FAST "colonist/colonist_infested_fall"
#define FRAME_TURTLE_JUMP_FAST "colonist/colonist_infested_jump"
#define FRAME_TURTLE_MOVE_FAST "colonist/colonist_infested_walk"

#define FRAME_TURTLE_IDLE_STRENGTH "worker/worker_infested_idle"
#define FRAME_TURTLE_FALL_STRENGTH "worker/worker_infested_fall"
#define FRAME_TURTLE_JUMP_STRENGTH "worker/worker_infested_jump"
#define FRAME_TURTLE_MOVE_STRENGTH "worker/worker_infested_walk"
#define FRAME_TURTLE_PUSH_STRENGTH "worker/worker_infested_push"

#define FRAME_TURTLE_IDLE_WARRIOR "guard/guard_infested_idle"
#define FRAME_TURTLE_FALL_WARRIOR "guard/guard_infested_fall"
#define FRAME_TURTLE_JUMP_WARRIOR "guard/guard_infested_jump"
#define FRAME_TURTLE_MOVE_WARRIOR "guard/guard_infested_walk"
#define FRAME_TURTLE_THROW_WARRIOR "guard/guard_infested_throw"

#define FRAME_TURTLE_IDLE_NINJA "overseer/overseer_infested_idle"
#define FRAME_TURTLE_FALL_NINJA "overseer/overseer_infested_fall"
#define FRAME_TURTLE_JUMP_NINJA "overseer/overseer_infested_jump"
#define FRAME_TURTLE_MOVE_NINJA "overseer/overseer_infested_walk"
#define FRAME_TURTLE_SLASH_NINJA "overseer/overseer_infested_slash"

#define FRAME_TURTLE_IDLE_ANGEL "jetpack/jetpack_infested_idle"
#define FRAME_TURTLE_FALL_ANGEL "jetpack/jetpack_infested_fall"
#define FRAME_TURTLE_JUMP_ANGEL "jetpack/jetpack_infested_jump"
#define FRAME_TURTLE_MOVE_ANGEL "jetpack/jetpack_infested_walk"

#define FRAME_ROCK "box/box"
#define FRAME_LEFT_BELT "conveyor/c_belt_left"
#define FRAME_MID_BELT "conveyor/c_belt_middle"
#define FRAME_RIGHT_BELT "conveyor/c_belt_right"
#define FRAME_HINT "tutorial/signpost"
#define FRAME_SPIKE "spikes/spikes"
#define FRAME_AIR "topdown_cannon/topdown_cannon"
#define FRAME_NAIR "ground_cannon/ground_cannon"
#define FRAME_AIM "flybot/flybot"
#define FRAME_TREE_IDLE "door/door-idle"
#define FRAME_TREE_CUT_OFF "door/door"
#define FRAME_CRUSHER_IDLE "crusher/crusher-idle"
#define FRAME_CRUSHER_CRUSH "crusher/crusher"
#define FRAME_TELEPORT "teleport/teleport"

#define FRAME_WARRIOR_IDLE "guard/guard_idle"
#define FRAME_WARRIOR_MOVE "guard/guard_walk"
#define FRAME_WARRIOR_THROW "guard/guard_throw"

#define FRAME_DEATH_IDLE "droid/droid_idle"
#define FRAME_DEATH_MOVE "droid/droid_walk"
#define FRAME_DEATH_THROW "droid/droid_throw"

#define FRAME_FAST_IDLE "colonist/colonist_idle"
#define FRAME_FAST_MOVE "colonist/colonist_walk"

#define FRAME_STRENGTH_IDLE "worker/worker_idle"
#define FRAME_STRENGTH_MOVE "worker/worker_walk"

#define FRAME_NINJA_IDLE "overseer/overseer_idle"
#define FRAME_NINJA_MOVE "overseer/overseer_walk"

#define FRAME_ANGEL_IDLE "jetpack/jetpack_idle"
#define FRAME_ANGEL_MOVE "jetpack/jetpack_walk"

#define FRAME_BULLET_1 "effects/bullet-1.png"
#define FRAME_BULLET_2 "effects/bullet-2.png"
#define FRAME_BULLET_3 "effects/bullet-3.png"
#define FRAME_BULLET_4 "effects/bullet-4.png"

#define FRAME_LOGO "sprites/logo.png"
#define FRAME_CONFIRM_DIALOG "sprites/box-confirm.png"
#define FRAME_PAUSE_DIALOG "sprites/box-pause.png"
#define FRAME_PREVIOUS_COMMAND "sprites/previous-command.png"
#define FRAME_NEXT_COMMAND "sprites/next-command.png"
#define FRAME_BUTTON_SMALL "sprites/button-small.png"
#define FRAME_BUTTON_SMALL_SELECTED "sprites/button-small-selected.png"
#define FRAME_BUTTON_PAUSE "sprites/pause.png"

#define STATE_SHOW "show"
#define STATE_HIDE "hide"

#define FUNCTION_CALL_BACK_OK_NEW_GAME 1
#define FUNCTION_CALL_BACK_CLOSE_NEW_GAME 2
#define FUNCTION_CALL_BACK_PLAY_GAME 3
#define FUNCTION_CALL_BACK_YES_QUIT_GAME 4
#define FUNCTION_CALL_BACK_NO_QUIT_GAME 5

#define COMMAND_CONTINUE 1
#define COMMAND_NEW_GAME 2
#define COMMAND_EFFECT 3
#define COMMAND_MUSIC 4

#define TXT_TITLE "droid tap games 2015"
#define TXT_SAVED_TEXT "%d$%d$%d"
#define TXT_NEW_GAME "new game"
#define TXT_CONTINUE "continue"
#define TXT_RESTART "restart"
#define TXT_QUIT "quit"
#define TXT_MUSIC "music %s"
#define TXT_EFFECT "effect %s"
#define TXT_CONFIRM_NEW_GAME_DESCRIPTION "Are you sure you want to reset the game\n\nYour current level is %d"
#define TXT_CONFIRM_NEW_GAME_TITLE "reset game"
#define TXT_CONFIRM_NEW_GAME_OK "ok"
#define TXT_CONFIRM_NEW_GAME_CLOSE "close"
#define TXT_CONFIRM_QUIT_GAME_DESCRIPTION "Are you sure you want to quit the game"
#define TXT_CONFIRM_QUIT_GAME_TITLE "quit game"
#define TXT_CONFIRM_QUIT_GAME_YES "yes"
#define TXT_CONFIRM_QUIT_GAME_NO "no"
#define TXT_ON "on"
#define TXT_OFF "off"
#define TXT_LEVEL "Level %d"

#define DOC_USER "user.dat"
#define UG_KEY "ug"

#define MOVE_KEY_NONE 0
#define MOVE_KEY_LEFT 1
#define MOVE_KEY_RIGHT 2
#define TOUCH_KEY_A 3
#define TOUCH_KEY_B 4
#define TOUCH_KEY_C 5

#endif /* defined(__NinjaTurtle__Constant__) */